﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using SSP;

namespace SSPDemo
{
    class OpeningMovie:SSPScene
    {
        SSPMovie openingMovie;

        public OpeningMovie()
        {
            openingMovie = new SSPMovie("opening");
            this.addChild(openingMovie);
            isInputEnabled = true;
            openingMovie.Play();
        }

        public override void update()
        {
            if (openingMovie.isDone())
            {
                SSPLevelProcessor xmlTest = new SSPLevelProcessor();
                SSPLevelDefinition testLevelDef = xmlTest.Read("l0.xml");

                SSPDirector.Instance.replaceScene(new PlayableLevel(testLevelDef));
            }
            base.update();
        }

        public override void DoPlayerAction(PlayerAction action)
        {
            if (action == PlayerAction.Jump)
            {
                openingMovie.Stop();
            }
        }
    }
}
